raar.agent.process.actor
Class RAFactory

java.lang.Object
  extended by raar.agent.process.RAProcess
      extended by raar.agent.process.actor.RAActor
          extended by raar.agent.process.actor.RAFactory
All Implemented Interfaces:
java.io.Serializable, RAAgentDependentProcess, RAWorldDependentProcess

public class RAFactory
extends RAActor
implements RAAgentDependentProcess, RAWorldDependentProcess

The factory actor is able to construct and remove objects to/from the world.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class raar.agent.process.RAProcess
hasRun, inregister, outregister, register, sourceCode, statement
 
Fields inherited from interface raar.agent.process.RAAgentDependentProcess
NO_AGENT_DEFINED
 
Fields inherited from interface raar.agent.process.RAWorldDependentProcess
NO_OBJECT_DEFINED
 
Constructor Summary
RAFactory(RAAgent agent, java.lang.String className)
          Construct, say which agent owns the actor and which class name it can construct.
 
Method Summary
 java.lang.String getDescription()
          Describe the actor.
 java.lang.String getProcessableName()
          Return the processable class (or object) name.
 boolean isInputValid(RADataType d)
          Return whether input is valid.
 boolean isProcessable(RAWorldObject obj)
          Return whether the object in question is processable by this process based on the current configuration.
 boolean isSuitable(RAWorldObject obj)
          Return whether the object in question is suitable for this process, i.e. processable either with the current or an other configuration.
 void removeReferenceToAgent()
          Remove agent reference.
 void run()
          Run the actor.
 void setProcessableName(java.lang.String name)
          Set the processable class (or object) name.
 void setReferenceToAgent(RAAgent a)
          Restore agent reference.
 java.lang.String toString()
          To string.
 boolean usesClasses()
          Return whether this processes uses world classes (true) or objects (false).
 
Methods inherited from class raar.agent.process.actor.RAActor
acceptsInput, dumpRegisters, execute, get, getActorValue, getDataType, getInputNames, getInputObjects, getOutputNames, getOutputObjects, set, setSourceCode
 
Methods inherited from class raar.agent.process.RAProcess
clone, getProcessName, getSourceCode, isSpecial, reset, setProcessName, suppliesOutput
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RAFactory

public RAFactory(RAAgent agent,
                 java.lang.String className)
Construct, say which agent owns the actor and which class name it can construct.

Method Detail

removeReferenceToAgent

public void removeReferenceToAgent()
Remove agent reference.

Specified by:
removeReferenceToAgent in interface RAAgentDependentProcess

setReferenceToAgent

public void setReferenceToAgent(RAAgent a)
Restore agent reference.

Specified by:
setReferenceToAgent in interface RAAgentDependentProcess

run

public void run()
         throws RAException
Run the actor.

Overrides:
run in class RAActor
Throws:
RAException

isInputValid

public boolean isInputValid(RADataType d)
Return whether input is valid.

Specified by:
isInputValid in class RAActor

isSuitable

public boolean isSuitable(RAWorldObject obj)
Return whether the object in question is suitable for this process, i.e. processable either with the current or an other configuration.

Specified by:
isSuitable in interface RAWorldDependentProcess

isProcessable

public boolean isProcessable(RAWorldObject obj)
Return whether the object in question is processable by this process based on the current configuration. If it is processable, it must also be suitable.

Specified by:
isProcessable in interface RAWorldDependentProcess

usesClasses

public boolean usesClasses()
Return whether this processes uses world classes (true) or objects (false).

Specified by:
usesClasses in interface RAWorldDependentProcess

getProcessableName

public java.lang.String getProcessableName()
Return the processable class (or object) name.

Specified by:
getProcessableName in interface RAWorldDependentProcess

setProcessableName

public void setProcessableName(java.lang.String name)
Set the processable class (or object) name.

Specified by:
setProcessableName in interface RAWorldDependentProcess

toString

public java.lang.String toString()
To string.

Overrides:
toString in class java.lang.Object

getDescription

public java.lang.String getDescription()
Describe the actor.

Specified by:
getDescription in class RAActor